$(function(){
    $(".btn-primary").click(function(){

            var goods_type_name = $('.goods_type_name').val();
            if(goods_type_name==''){
                errorTips('btn-primary',$(".goods_type_name"),"请输入分类名称");
                return ;
            }
            /*
             *表单提交
             */
                var uri = $("#g_type").attr("action");
                var data = $("form[id=g_type]").serialize();
                ajaxPost(uri, $(".btn-primary"), data, function(r){
                    $(".btn-primary").removeAttr("disabled");
                    location.href = r.url;
                });
            });
    $(".type").change(function(){
        var num = $(".type").val();
        if(num == 0){
            console.log(num);
            $('.zhu').show();
        }else{
            console.log(num);
            $('.zhu').hide();
        }
    });
});